<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8" />
        <title>司机信息</title>
        <link rel="stylesheet" href="/Public/Leader/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="/Public/Leader/css/index.css" />
        <style type="text/css">
            .order-list a {
                position: relative;
            }
            .order-list span {
                float: right;
                margin-right: 20px;
            }
            .pagination ul {
                display: inline-block;
                margin-left: 0;
                margin-bottom: 0;
                -webkit-border-radius: 3px;
                -moz-border-radius: 3px;
                border-radius: 3px;
                -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
                -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
                box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            }
            .pagination ul > li {
                display: inline;
            }
            .pagination ul > li > a, .pagination ul > li > span {
                float: left;
                padding: 0 14px;
                line-height: 38px;
                text-decoration: none;
                background-color: #ffffff;
                border: 1px solid #dddddd;
                border-left-width: 0;
            }
        </style>
    </head>
    <body>
        <style>
    .pagination .current{
        float: left;
    padding: 0 14px;
    line-height: 38px;
    text-decoration: none; 
    border-left-width: 0;
    }
        
</style>
<div id="topbar" class="top-navigation dark-bg ">
            <nav class="navbar   dark-bg " role="navigation" style="width:85%;margin:auto;">
                <div class="navbar-header" style="width:200px;">
                    <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
                        <i class="fa fa-reorder"></i>
                    </button>
                    <a class="navbar-brand" href="<?php echo U('Index/index');?>">小易出行</a>
                </div>
                <div class="navbar-collapse collapse" id="navbar">
                    <ul class="nav navbar-nav dark-bg">
                        

                        <li <?php if($table == 'index'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Index/index');?>"> 首页</a>
                        </li>

                        <li <?php if($table == 'order'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Order/orderadmin');?>">订单管理</a>
                        </li>

                        <li <?php if($table == 'pay'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Pay/paycount');?>">交易中心</a>
                        </li>
                        <li <?php if($table == 'article'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Article/lst');?>">文章</a>
                        </li>
                        <li <?php if($table == 'wx'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Wx/wx_menu/wid/1');?>">微信管理</a>
                        </li>
                        <li <?php if($table == 'line'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Line/lineadmin');?>">线路管理</a>
                        </li>
                        <li <?php if($table == 'user'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('User/userinfo');?>">用户管理</a>
                        </li>
                        <li <?php if($table == 'useradmin'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Useradmin/userinfo');?>">系统管理</a>
                        </li>

                    </ul>
                    <ul class="nav navbar-top-links navbar-right">
                        <li class="dropdown">
                            <a aria-expanded="false" role="button" href="#" class="dropdown-toggle" data-toggle="dropdown" style="position:relative;" onclick="$(this).find('span').toggleClass('deg180')">
                                <name style="width: 80px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;display: block;text-align: center"><?php echo session('username');?></name>
                                <span class="caret" style="position: absolute;top: 22px;right: 12px;"></span></a>
                            <ul role="menu" class="dropdown-menu">
                                <li>
                                    <a onclick="return confirm('您确定要退出吗？')" tabindex="-1" href="<?php echo U('Login/Logout');?>">退出</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </div>
        <div class="wrapper main-wrapper wrapper-content ">
            <div class="page-menubar">
                <div class="menu-header">用户管理</div>
                <ul class="order-list">
                    <li>
                        <a href="<?php echo U('User/userinfo');?>">用户信息</a>
                    </li>
                    <li>
                        <a href="<?php echo U('User/sijiinfo');?>">司机信息</a>
                    </li>
                    
                    <li class="active">
                        <a href="<?php echo U('User/fankui_list');?>">用户反馈</a>
                    </li>
                </ul>
            </div>
            <!--主要内容-->
            <div class="page-content" style="display: block;">
                <!--内容标题-->
                <!-- <div class="page-heading" style="position:relative;">
                    <h2>司机列表</h2>
                     <a  href="<?php echo U('User/addsiji');?>" class="btn btn-primary" style="position:absolute;right: 0;top: 10px;">添加司机</a>
                </div> -->
                
                <div class="panel panel-default" style="margin-top: 20px;">
                    <div class="panel-body">
                        <table class="table table-hover table-responsive">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>姓名</th>
                                    <th>电话</th>
                                    <th>留言内容</th>
                                    <th style="min-width: 64px;">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                                    <th><?php echo ($vo["id"]); ?></th>
                                    <td><?php echo ($vo["0"]["nickname"]); ?></td>
                                    <td><?php echo ($vo["0"]["dianhua"]); ?></td>

                                    <Td>
                                        <a href="/admin.php/User/sijixg/id/<?php echo ($vo["id"]); ?>"><i class="glyphicon glyphicon-pencil"></i></a>
                                        <a onclick="return confirm('正在删除用户，请确认')"href="/admin.php/User/delsj/id/<?php echo ($vo["id"]); ?>"><i class="glyphicon glyphicon-remove-sign"></i></a>
                                    </td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>

                            </tbody>
                        </table>
                    </div>
                    <?php echo ($page); ?>
                </div>
            </div>
        </div>
        <!--模态框-->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title" id="myModalLabel">修改人员信息</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">姓名</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="name" placeholder="请输入姓名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">手机号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="tel" placeholder="请输入手机号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">收货地址</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="address" placeholder="请输入收货地址">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="name">标记</label>
                                <div class="col-sm-5">
                                    <a  class="btn btn-success" id="kefu" data-qx="1">标记为客服</a>
                                </div>
                                <div class="col-sm-5">
                                    <a  class="btn btn-info" id="ps" data-qx="2">标记为派送员</a>
                                </div>
                            </div>
                        </form>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary " id="tjbtn">确认修改</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div>
    </body>
    <script src="/Public/Leader/js/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="/Public/Leader/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script>
                 $(function () {
//            function list(){
//                var html="";
//                $.ajax({
//                    url:"",
//                    data:{
//                      
//                    },
//                    type:"get",
//                    success:function(data){
//                        for(var i=0;i<data.length;i++){
//                            html+='<tr>'              
//                                +    '<td>'+data[i].id+'</td>'
//                                +    '<td><img src="<?php echo ($vo['headimg']); ?>" alt="" style="width: 40px;height: 40px;" /></td>
//                                +    '<td>'+data[i].nickname+'</td>'
//                                +    '<td class="name">'+data[i].name+'</td>'
//                                +    '<td class="tel">'+data[i].tel+'</td>'
//                                +    '<td class="address">'+data[i].address+'</td>'
//                                +    '<td>'+data[i].yue+'</td>'
//                                +    '<td>'+data[i].addtime+'</td>
//                                +    '<td class="changer porint pad10" data-id="'+data[i].id+'"><a href="javascript:;">修改</a></td>'
//                                +'</tr>'
//                        }
//                        $("#trcontent").html(html);
//                  },
//              })  
//            };
//            list();
                     function setuser(id, qx) {
                         $.ajax({
                             url: "<?php echo U('User/userbj');?>",
                             data: {
                                 id: id,
                                 qx: qx,
                             },
                             type: "post",
                             success: function (data) {
                                 if (data == 0) {
                                     alert("标记成功");
                                     window.location.reload();
                                     return false;
                                 } else if (data == 1) {
                                     alert("标记失败");
                                     return false;
                                 }
                             }
                         })
                     }
                     ;
                     $("#kefu").click(function () {
                         var id = $(this).attr("data-id");
                         var qx = $(this).attr("data-qx");
                         setuser(id, qx)
                     });
                     $("#ps").click(function () {
                         var id = $(this).attr("data-id");
                         var qx = $(this).attr("data-qx");
                         setuser(id, qx)
                     });
                     $(".changer").click(function () {
                         var id = $(this).attr("data-id");
                         var name = $(this).siblings('.name').text();
                         var tel = $(this).siblings('.tel').text();
                         var address = $(this).siblings('.address').text();
                         console.log(name);
                         console.log(tel);
                         console.log(address);
                         $("#name").val(name);
                         $("#tel").val(tel);
                         $("#address").val(address);
                         $("#tjbtn").attr("data-id", id);
                         $("#kefu").attr("data-id", id);
                         $("#ps").attr("data-id", id);
                         $("#myModal").modal('show');
                     });
                     $("#tjbtn").click(function () {
                         var id = $(this).attr("data-id");
                         var name = $("#name").val();
                         ;
                         var tel = $("#tel").val();
                         var address = $("#address").val();
                         if (name == "") {
                             alert("用户名不能为空");
                             return false;
                         } else if (tel == "") {
                             alert("手机号不能为空");
                             return false;
                         } else if (address == "") {
                             alert("地址不能为空");
                             return false;
                         }
                         $.ajax({
                             url: "<?php echo U('User/userxg');?>",
                             data: {
                                 id: id,
                                 name: name,
                                 tel: tel,
                                 address: address
                             },
                             type: "post",
                             success: function (data) {
                                 if (data == 0) {
                                     alert("修改成功");
                                     window.location.reload();
                                     return false;
                                 } else if (data == 1) {
                                     alert("修改失败");
                                     return false;
                                 }
                             }
                         })
                     });
                 })
    </script>
</html>